package com.jlc.book.shop.delegate;



import com.jlc.book.shop.dao.UserDAO;
import com.jlc.book.shop.factory.DAOFactory;
import com.jlc.book.shop.to.UserTO;

public class UserDelegate {
	private static UserDAO userDAO=null;
	
	static
	{
		userDAO=DAOFactory.getUserDAO();
	}

	public static UserTO verifyUser(String username, String password) {
		
		return userDAO.verifyUser(username,password);
	}

	
	
	public static boolean registerUser(UserTO uto) {
		
		return userDAO.registerUser(uto);
	}

	public static boolean alreadyExit(String username) {
		
		return userDAO.alreadyExit(username);
	}

	public static String searchPassword(String uname, String email) {
		
		return userDAO.searchPassword(uname,email);
	}



	public static UserTO changePassword(UserTO usto, String newpass) {
		
		return userDAO.changePassword(usto, newpass);
	}



	public static UserTO getUserInfoById(String userId) {
		
		return userDAO.getUserInfoById(userId);
	}



	public static boolean updateUserInfo(String userId, String email,
			long phone) {
		
		return userDAO.updateUserInfo(userId,email,phone);
	}

	


}
